Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-product acquisition updates #9552

Merged
merged 11 commits into from
Oct 17, 2024

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Oct 9, 2024

Fixes #9011
Contributes to #8186
Contributes to dotnet/sdk#25575

There are a few changes here:

  1. When the project sets <IsRoslynComponent> to true, the relevant VS component is now provided to IPA so that the user can be prompted to install it if missing. This avoids confusion. Without this, no warning is given, but the user won't be able to get their analyzer or source generator to work.

  2. Moves some logic from C# code to MSBuild targets, with a view to later moving that logic into the SDK, meaning:

    • IPA components no longer subscribe to evaluation data. Everything now comes from the DTB via the CollectSuggestedVisualStudioComponentIds target.
    • The mapping between TargetFrameworkVersion and VS component ID moves from C# to MSBuild. Ultimately it should move to the SDK, and this change helps facilitate that.
    • We have a simpler data exchange between targets and C#. Previously there was a SuggestedWorkload item that specified components. However, we don't want to limit this feature to workloads. So the unpacking of workloads from the SDK to components happens in a target, and we just pass component IDs as item specs to the project system.
  3. Allocate less memory by reusing portions of persistent collections where possible, instead of recreating new immutable instances.

  4. Adds a diagnostic mode where the project node displays the project's component IDs. To enable it, the user should add the DiagnoseVisualStudioComponents project capability. Solution Explorer will then display a new "Setup components" subtree, resembling:

Microsoft Reviewers: Open in CodeFlow

The previous name was a little misleading.
This moves some logic from C# code to MSBuild targets, with a view to later moving that logic into the SDK.

This change has a few ramifications:

1. IPA components no longer subscribe to evaluation data. Everything now comes from the DTB.
1. The mapping between `TargetFrameworkVersion` and VS component ID moves from C# to MSBuild. Ultimately it should move to the SDK, and this change helps facilitate that.
1. We have a simpler data exchange between targets and C#. Previously there was a `SuggestedWorkload` item that specified components. However we don't want to limit this feature to workloads. So the unpacking of workloads from the SDK to components happens in a target, and we just pass component IDs as item specs to the project system.
1. Allocate less memory by reusing portions of persistent collections where possible, instead of recreating new immutable instances.
This adds a subtree to the project node that displays the project's component IDs. To enable it, the user should add the `DiagnoseVisualStudioComponents` project capability.
@drewnoakes drewnoakes added Tenet-User Friendly This issue affects the "User Friendly" tenet; UI usability, accessibility or high-DPI related. Feature-Acquisition In-Product Acquisition (IPA), to detect and prompt to install of components and workloads via setup labels Oct 9, 2024
@drewnoakes drewnoakes requested a review from a team as a code owner October 9, 2024 11:36
@drewnoakes drewnoakes added this to the 17.13 milestone Oct 9, 2024
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document is more of a spec for the IPA feature and doesn't reflect what was actually built. It should probably be trimmed heavily, and only content relevant to this repo kept.

@drewnoakes drewnoakes merged commit c7bde6d into dotnet:main Oct 17, 2024
5 checks passed
@drewnoakes drewnoakes deleted the ipa-roslyn-components-targets branch October 17, 2024 14:30
@dotnet-policy-service dotnet-policy-service bot modified the milestones: 17.13, 17.12 Oct 17, 2024
drewnoakes added a commit to drewnoakes/project-system that referenced this pull request Oct 25, 2024
Two recent PRs merged and caused a simple build break, which is fixed here.

- dotnet#9561
- dotnet#9552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Acquisition In-Product Acquisition (IPA), to detect and prompt to install of components and workloads via setup Tenet-User Friendly This issue affects the "User Friendly" tenet; UI usability, accessibility or high-DPI related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically prompt to install the ".NET Compiler Platform SDK" VS component when needed
3 participants